<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/cloudtrace/v2/trace.proto

namespace Google\Cloud\Trace\V2;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * An event describing a message sent/received between Spans.
 *
 * Generated from protobuf message <code>google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent</code>
 */
class Span_TimeEvent_MessageEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * Type of MessageEvent. Indicates whether the message was sent or
     * received.
     *
     * Generated from protobuf field <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
     */
    private $type = 0;
    /**
     * An identifier for the MessageEvent's message that can be used to match
     * SENT and RECEIVED MessageEvents. It is recommended to be unique within
     * a Span.
     *
     * Generated from protobuf field <code>int64 id = 2;</code>
     */
    private $id = 0;
    /**
     * The number of uncompressed bytes sent or received.
     *
     * Generated from protobuf field <code>int64 uncompressed_size_bytes = 3;</code>
     */
    private $uncompressed_size_bytes = 0;
    /**
     * The number of compressed bytes sent or received. If missing assumed to
     * be the same size as uncompressed.
     *
     * Generated from protobuf field <code>int64 compressed_size_bytes = 4;</code>
     */
    private $compressed_size_bytes = 0;

    public function __construct() {
        \GPBMetadata\Google\Devtools\Cloudtrace\V2\Trace::initOnce();
        parent::__construct();
    }

    /**
     * Type of MessageEvent. Indicates whether the message was sent or
     * received.
     *
     * Generated from protobuf field <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Type of MessageEvent. Indicates whether the message was sent or
     * received.
     *
     * Generated from protobuf field <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Trace\V2\Span_TimeEvent_MessageEvent_Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * An identifier for the MessageEvent's message that can be used to match
     * SENT and RECEIVED MessageEvents. It is recommended to be unique within
     * a Span.
     *
     * Generated from protobuf field <code>int64 id = 2;</code>
     * @return int|string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * An identifier for the MessageEvent's message that can be used to match
     * SENT and RECEIVED MessageEvents. It is recommended to be unique within
     * a Span.
     *
     * Generated from protobuf field <code>int64 id = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkInt64($var);
        $this->id = $var;

        return $this;
    }

    /**
     * The number of uncompressed bytes sent or received.
     *
     * Generated from protobuf field <code>int64 uncompressed_size_bytes = 3;</code>
     * @return int|string
     */
    public function getUncompressedSizeBytes()
    {
        return $this->uncompressed_size_bytes;
    }

    /**
     * The number of uncompressed bytes sent or received.
     *
     * Generated from protobuf field <code>int64 uncompressed_size_bytes = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setUncompressedSizeBytes($var)
    {
        GPBUtil::checkInt64($var);
        $this->uncompressed_size_bytes = $var;

        return $this;
    }

    /**
     * The number of compressed bytes sent or received. If missing assumed to
     * be the same size as uncompressed.
     *
     * Generated from protobuf field <code>int64 compressed_size_bytes = 4;</code>
     * @return int|string
     */
    public function getCompressedSizeBytes()
    {
        return $this->compressed_size_bytes;
    }

    /**
     * The number of compressed bytes sent or received. If missing assumed to
     * be the same size as uncompressed.
     *
     * Generated from protobuf field <code>int64 compressed_size_bytes = 4;</code>
     * @param int|string $var
     * @return $this
     */
    public function setCompressedSizeBytes($var)
    {
        GPBUtil::checkInt64($var);
        $this->compressed_size_bytes = $var;

        return $this;
    }

}

